%%% -------------------------------------------------------------------
%%% Author  : tangj
%%% Description :
%%%
%%% Created : 2012-9-22
%%% -------------------------------------------------------------------
-module(gateway_sup).
-behaviour(supervisor).

-export([
		 start_link/0, 
		 start_child/1, 
		 start_child/2, 
		 init/1
  		]).

%% --------------------------------------------------------------------

start_link() ->
	{ok, Pid} = supervisor:start_link({local, ?MODULE}, ?MODULE, []),
	io:format("gateway_sup start_link~p~n", [Pid]),
	{ok, Pid}.

start_child(Mod) ->
    start_child(Mod, []).

start_child(Mod, Args) ->
    {ok, _} = supervisor:start_child(?MODULE,
                                     {Mod, {Mod, start_link, Args},
                                      transient, 100, worker, [Mod]}),
    ok.

init([]) -> 
	{ok, {   
		  {one_for_one, 3, 10},   
		  []
		 }
	}.


